import { Image, Button } from "antd";
import { PageContainer } from "@ant-design/pro-layout";
import useCommonTable from "@/hooks/useCommonTable";
import { fetchList } from "@/api/agreement";
import { PlusOutlined } from "@ant-design/icons";
import { history } from "umi";
import { filterPackageType } from "@/const";

const Package = () => {
  const columns = [
    {
      title: "名称",
      dataIndex: "name",
      width: 150,
      search: false,
    },
  ];

  return (
    <PageContainer>
      {useCommonTable({
        search:false,
        columns,
        modalWidth: 700,
        renderAdd:() => {},
        fetchList,
        renderEdit: (record) => {
          return (
            <Button
              key="add"
              type="primary"
              onClick={() => {
                history.push(`/agreement/edit?id=${record.id}`);
              }}
            >
              编辑
            </Button>
          );
        },
        layout: "horizontal",
        actionColumnWidth: 200,
        showCheckbox: false,
      })}
    </PageContainer>
  );
};

export default Package;
